package com.jic.order.enums;

/**
 * @author xuyongliang
 * @version V1.0
 * @className AfterSaleStatusEnum
 * @description 售后状态
 * @date 2020/2/13
 */
public enum AfterSaleStatusEnum {
    // 1010:申请退款待处理; 1020:取消售后; 1030:审核通过; 1040:审核拒绝; 1050:审核后取消售后; 1060:退款中; 1070:退款成功;1080:换货待处理;1090:换货已收货;1100：换货已发货
    APP_REFUND(1010, "申请售后待处理"),
    CANCEL_AFTER_SALE(1020, "取消售后"),
    AUDIT_PASS(1030, "审核通过"),
    AUDIT_REJECT(1040, "审核拒绝"),
    POST_AUDIT_CANCEL_AFTER_SALE(1050, "审核后取消售后"),
    REFUNDING(1060, "退款中"),
    REFUND_SUCCESS(1070, "退款成功"),
    EXCHANGE_PENDING(1080, "换货待处理"),
    EXCHANGE_RECEIVED(1090, "换货已收货"),
    EXCHANGE_HAS_BEEN_SHIPPED(1100, "换货已发货");

    private Integer code;

    private String message;

    AfterSaleStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public AfterSaleStatusEnum getByCode(Integer code){
        AfterSaleStatusEnum[] values = AfterSaleStatusEnum.values();
        for(AfterSaleStatusEnum value : values){
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
